﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

using Ras2ClassLib;

namespace Ras2Web
{
    public partial class HitList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                String strID = Request.QueryString["ID"];
                int nID = 0;

                if (Int32.TryParse(strID, out nID))
                {
                    this.ViewState["HitListID"] = strID;
                    HitListController ctrl = new HitListController();

                    m_gridHitList.DataSource = ctrl.GetSongsOnHitList(nID);
                    m_gridHitList.DataBind();

                    // Birtum nafn listans fyrir ofan listann
                    m_lbHitListName.Text = ctrl.GetHitListByID(nID).Name;
                }
                else
                {
                    Response.Redirect("~/default.aspx");
                }
            }
        }
    }
}
